import React, { Component } from 'react';
import Swiper from './ui/Swiper';
import connect from './connect'
import Search from './ui/Search';
import Hotcate from './ui/Hotcate';
import List from '@/components/List';
import Header from '@/components/Header'

@connect
class index extends Component {
  componentDidMount() {
    // swiper初始化操作
    this.props.initSwiper()
    // 热门分类
    this.props.getHotCateData()

    this.props.getGoodCookbookData()
  }
  render() {
    return (
      <>
        {/* 顶部导航 */}
        <Header />
        {/* 顶部切换图片 */}
        <Swiper />
        {/* 搜索 */}
        <Search />
        {/* 热门分类 */}
        <Hotcate />
        {/* 好菜 */}
        <List data={this.props.goodcookbook} />
      </>
    );
  }
}

export default index;
